import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:kkhousekeep/net/me_account_connect.dart';
import 'package:kkhousekeep/tools/shared_preferences.dart';
import 'package:shared_preferences/shared_preferences.dart';

class EditNicknameController extends GetxController {
  var username = "".obs;
  var isAsh = false.obs;
  TextEditingController nicknameTextEditingController = TextEditingController();
  late MeAccountConnect _meAccountConnect;
  @override
  void onInit() {
    _meAccountConnect = Get.put(MeAccountConnect());
    SharedPreferences.getInstance()
        .getUserName()
        .then((value) => username.value = value);
    nicknameTextEditingController.text = username.value;
    nicknameTextEditingController.addListener(() {
      username.value = nicknameTextEditingController.text;
      observeText();
    });
    super.onInit();
  }

  void observeText(){
      isAsh.value = username.value.isEmpty;
  }
  
  void save(){
  }
}
